package com.mercury.logs.listener;

import com.mercury.logs.entity.MercuryLogEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;


/**
 * 日志监听
 *
 * @author mercury
 */
@Slf4j
public class MercuryLogListener {


    @Order
    @EventListener(MercuryLogEvent.class)
    public void saveSysLog(MercuryLogEvent event) {
        MercuryLogEntity sysLog = (MercuryLogEntity) event.getSource();
        //入库逻辑
        log.info("保存日志 sysLog:{}", sysLog);
    }
}
